package com.southminority.ethnic.controller.admin.language.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

/**
 * 句子对比管理端VO
 * 
 * @author SouthMinority
 */
public class LanguageSentenceAdminVO {

    /**
     * 句子对比创建请求VO
     */
    @Data
    @Schema(description = "句子对比创建请求")
    public static class CreateRequest {
        
        @NotBlank(message = "汉语意思不能为空")
        @Schema(description = "汉语意思", required = true)
        private String chineseMean;
        
        @NotNull(message = "少数民族分类不能为空")
        @Schema(description = "少数民族分类：1=苗语东部方言, 2=苗语中部方言, 3=苗语西部方言, 4=布依语, 5=侗语", required = true)
        private Integer minorityCategory;
        
        @Schema(description = "中文读音")
        private String chinesePronunciation;
        
        @Schema(description = "少数民族音标")
        private String minorityPhoneticSymbol;
        
        @Schema(description = "音频地址")
        private String audioAddress;
    }

    /**
     * 句子对比更新请求VO
     */
    @Data
    @Schema(description = "句子对比更新请求")
    public static class UpdateRequest {
        
        @NotNull(message = "ID不能为空")
        @Schema(description = "主键ID", required = true)
        private Long id;
        
        @NotBlank(message = "汉语意思不能为空")
        @Schema(description = "汉语意思", required = true)
        private String chineseMean;
        
        @NotNull(message = "少数民族分类不能为空")
        @Schema(description = "少数民族分类：1=苗语东部方言, 2=苗语中部方言, 3=苗语西部方言, 4=布依语, 5=侗语", required = true)
        private Integer minorityCategory;
        
        @Schema(description = "中文读音")
        private String chinesePronunciation;
        
        @Schema(description = "少数民族音标")
        private String minorityPhoneticSymbol;
        
        @Schema(description = "音频地址")
        private String audioAddress;
    }

    /**
     * 句子对比删除请求VO
     */
    @Data
    @Schema(description = "句子对比删除请求")
    public static class DeleteRequest {
        
        @NotNull(message = "ID不能为空")
        @Schema(description = "主键ID", required = true)
        private Long id;
    }

    /**
     * 句子对比详情响应VO
     */
    @Data
    @Schema(description = "句子对比详情响应")
    public static class DetailResponse {
        
        @Schema(description = "主键ID")
        private Long id;
        
        @Schema(description = "汉语意思")
        private String chineseMean;
        
        @Schema(description = "少数民族分类")
        private Integer minorityCategory;
        
        @Schema(description = "少数民族分类名称")
        private String minorityCategoryName;
        
        @Schema(description = "中文读音")
        private String chinesePronunciation;
        
        @Schema(description = "少数民族音标")
        private String minorityPhoneticSymbol;
        
        @Schema(description = "音频地址")
        private String audioAddress;
        
        @Schema(description = "创建时间")
        private String createTime;
        
        @Schema(description = "更新时间")
        private String updateTime;
        
        /**
         * 获取少数民族分类名称
         */
        public String getMinorityCategoryName() {
            if (minorityCategory == null) {
                return "未知";
            }
            switch (minorityCategory) {
                case 1:
                    return "苗语东部方言";
                case 2:
                    return "苗语中部方言";
                case 3:
                    return "苗语西部方言";
                case 4:
                    return "布依语";
                case 5:
                    return "侗语";
                default:
                    return "未知";
            }
        }
    }
} 